package com.lry.basic.design_mode.strategy.s_enum;
//超过100 9折，超过200 8折
public enum Promotion {
    NINE("9"){
        public double exec(double price){
            return price*0.9;
        }
    },
    EIGHT("8"){
        public double exec(double price){
            return price*0.8;
        }
    };
    String value = "";

    public String getValue() {
        return value;
    }

    private Promotion(String value) {
        this.value = value;
    }

    public abstract double exec(double price);

    public static void main(String[] args) {

        System.out.println(Promotion.NINE.exec(120));

    }
}
